From: Marco Trevisan (TreviƱo) Date: Tue, 17 Feb 2026 14:02:56 +0000 (+0100) Subject: search: Unset the results for the current provider if the new search failed X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~26^2~1^2~50 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=929c8b821d3b5f5e787d8f1349134ab3e1a4a46a;p=gnome-shell.git search: Unset the results for the current provider if the new search failed In case the provider search or subsearch failed, the old results are preserved, while they should be reset or we may show invalid data Part-of: --- diff --git a/js/ui/search.js b/js/ui/search.js index 76e49bc1e..b96ec635c 100644 --- a/js/ui/search.js +++ b/js/ui/search.js @@ -692,20 +692,22 @@ export const SearchResultsView = GObject.registerClass({ async _doProviderSearch(provider, previousResults) { provider.searchInProgress = true; - let results; - if (this._isSubSearch && previousResults) { - results = await provider.getSubsearchResultSet( - previousResults, - this._terms, - this._cancellable); - } else { - results = await provider.getInitialResultSet( - this._terms, - this._cancellable); + let results = []; + try { + if (this._isSubSearch && previousResults) { + results = await provider.getSubsearchResultSet( + previousResults, + this._terms, + this._cancellable); + } else { + results = await provider.getInitialResultSet( + this._terms, + this._cancellable); + } + } finally { + this._results[provider.id] = results; + await this._updateResults(provider, results); } - - this._results[provider.id] = results; - await this._updateResults(provider, results); } _doSearch() {